package cn.tedu.spring.teacher;

import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;


/**
 * Author：程Sir
 * Name： SpringTest01
 * Content:
 * 没有使用@Scope注解进行指定，那么默认就是单例模式
 */
@Lazy(value =true)
@Scope("singleton")
@Component
//@Scope("prototype")
public class Teacher {
    public Teacher (){
        System.out.println("Teacher构造方法运行了！！！");
    }
    private Integer id = 1232;
    private String name = "光头强";
    private Double sal = 11000.01;

    @Override
    public String toString() {
        return "Teacher{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sal=" + sal +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getSal() {
        return sal;
    }

    public void setSal(Double sal) {
        this.sal = sal;
    }


}
